#include "EpollServer.hpp"
#include <iostream>
#include <string>
#include <memory>

void Usage(std::string process)
{
    std::cerr << "Usage: " << process << "port" << std::endl;
}

// ./epoll_server 8888
int main(int argc, char *argv[])
{
    if(argc != 2)
    {
        Usage(argv[0]);
        return 1;
    }
    int port = std::stoi(argv[1]);
    std::unique_ptr<EpollServer> svr (new EpollServer(port));
    
    svr->InitServer();
    svr->Loop();

    return 0;
}